function address($scope, $http) {
	var province, city, county, flag;
	//我的地址列表
	url = getUrl("22address");
	header = getHeader();
	/*
	 params = {
	 accountId : readData(localStorage.account)
	 //y查询默认地址，n查询非默认地址，无此参数查询所有地址
	 //defaultAddr : 'n'
	 };
	 */
	datas = 'accountId=' + readData(localStorage.account)
	$http({
		method: 'POST',
		url: url,
		headers: header,
		timeout: 10000,
		//params : params
		data: datas
	}).success(function(data, status, headers, config) {
		if (data.obj) {
			$scope.allAddress = data.obj.list;
		} else {
			$scope.allAddress = null;
		};
	}).error(function(data, status, headers, config) {
		mui.toast("网络异常稍后重试")
	});
	//保存地址
	$scope.CheckIn = function() {
		url = getUrl("24addressAdd");
		if (document.getElementById('flag').checked == true) {
			flag = 'y';
		} else {
			flag = 'n';
		};
		header = getHeader();
		params = {
			accountId: readData(localStorage.account),
			shipname: $scope.Uname,
			shipaddress: $scope.address,
			province: province,
			city: city,
			area: county,
			phone: $scope.phone,
			defaultAddr: flag
		};
		datas = "accountId=" + readData(localStorage.account) + "&shipname=" + $scope.Uname + "&shipaddress=" + $scope.address + "&province=" + province + "&city=" + city + "&area=" + county + "&phone=" + $scope.phone + "&defaultAddr=" + flag;
		plus.nativeUI.showWaiting("正在提交")
		$http({
			method: 'POST',
			url: url,
			headers: header,
			timeout: 10000,
			//cache: true,
			data: datas
		}).success(function(data, status, headers, config) {
			if (data.code == "0") {
				orders = readData(localStorage.order);
				order = eval('(' + orders + ')');
				order['address'] = params;
				order['address']['id'] = data.obj.ordershopid;
				localStorage.order = writeData(JSON.stringify(order));
				plus.nativeUI.closeWaiting()
				backOrder();
			} else {
				mui.toast("网络异常稍后重试")
				plus.nativeUI.closeWaiting()
			}
		}).error(function(data, status, headers, config) {
			mui.toast("网络异常稍后重试")
			plus.nativeUI.closeWaiting()
		});
	}
	$scope.open = function() {
		var cityPicker3 = new mui.PopPicker({
			layer: 3
		});
		cityPicker3.setData(cityData3);
		cityPicker3.show(function(items) {
			//alert("你选择的城市是:" + (items[0] || {}).text + " " + (items[1] || {}).text + " " + (items[2] || {}).text);
			province = (items[0] || {}).text;
			city = (items[1] || {}).text;
			county = (items[2] || {}).text
			document.getElementById("city").value = province + city + county;
			//返回 false 可以阻止选择框的关闭
			//return false;
		});
	}
	$scope.addressUpdata = function(address) {
		orders = readData(localStorage.order);
		order = eval('(' + orders + ')');
		order['address'] = address;
		localStorage.order = writeData(JSON.stringify(order));
		backOrder();
	}

	//确认地址后操作
	function backOrder() {
		var oper = plus.webview.getWebviewById("conformOrder.html");
		mui.fire(oper, "reload");
		mui.back();
	}

}